<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .red{background: red;}
        .yellow{color: yellow}
        .orange{color: orange}
    </style>
</head>
<div id="app">
    <div class="{{style}}">123</div>
    //直接动态引入数据
    <div v-bind:class="style">123</div>
    //不是true就是false
    <div v-bind:class="{'red':true,'yellow':true}">123</div>
    //绑定数组
    <div :class="['red','yellow']">536</div>
    //三元表达式写法
    <div :class="['red',flag?'orange':'yellow']">536</div>
    //最简单的用法 数组和对象并用
    <!--<div class='color' ng-class="{red:flag}"></div>-->
    <div :class="['red',{yellow:flag},flag?'orange':'yellow']">789</div>
    <!--class="{{className}}" 和v:bind:class='obj' 不要混用-->
    <!--class 可以和v-bind:class共存-->
</div>
<body>
<script src="vue.js"></script>
<script>
    var vm = new Vue({
        el:'#app',
        data:{
            style:'red',
            flag:true
        }
    });
</script>
</body>
</html>